function slide_next_back() {
    if (run_next_mode)
        slide_next();
    else
        slide_back();
}
function slide_back() {
    run_next_mode = false;
    index--;
    if (index < 0)
        index = maxindex;
    slide_change();
}
function slide_next() {
    run_next_mode = true;
    index++;
    if (index > maxindex)
        index = 0;
    slide_change();
}

function slide_change() {
    var slide_id = document.getElementById("show");

    sLink = '/Tools/Slide.aspx?page=' + index + '&newsid=' + newsid;
    AjaxRequest.get(
		{
		    'url': sLink
		, 'onSuccess': function (req) {
		    if (req.responseXML.getElementsByTagName('Item').length > 0) {
		        var sHtml = '';
		        var sButton = '';
		        for (var i = 0; i < req.responseXML.getElementsByTagName('Item').length; i++) {
		            with (req.responseXML.getElementsByTagName('Item').item(i)) {
		                var file = getNodeValue(getElementsByTagName('File'));
		                sHtml += '<a href="javascript:;"><img width="132" height="99" src="' + file + '" onclick="showIMG(this.src)"/></a>';
		            }
		        }
		        slide_id.innerHTML = sHtml;
		    }
		}
		, 'onError': function (req) { }
		}
	)
}
